home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / doom / knbot03.zip / SRC.ZIP / BOT.QC < prev    next >
Text File  |  1997-03-12  |  6KB  |  198 lines

  1. /*
  2. ==============================================================================
  3.  
  4. KN BOT - version 0.2
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. // Prototypes
  10.  
  11. void    ()                                                Bot_Precache;
  12. void    (string name, string yn)                          BotCreate;
  13.  
  14. void (vector org) spawn_tfog;
  15.  
  16.  
  17. //=============================================================
  18. // Bot_Precache - called by Worldspawn
  19. //=============================================================
  20. void () Bot_Precache =
  21. {
  22. };
  23.  
  24. //=============================================================
  25. // BotActivate - Activates the bot
  26. //=============================================================
  27. void (string name, string yn) BotCreate =
  28. {
  29. // sounds and models precached in the world.qc file
  30.  
  31.     local entity    newbot;
  32.         local entity    spot;
  33.         local float     r;
  34.                                   
  35.         r = random ();
  36.         newbot = spawn();
  37.     newbot.solid = SOLID_SLIDEBOX;
  38.         newbot.movetype = MOVETYPE_STEP;
  39.         newbot.netname = name;
  40.         //newbot.cnetname = color; // added color
  41.  
  42. // BG Bot - Trying to get it to print Bot kills in Rankings.
  43.         newbot.cl = "client";
  44.         newbot.classname = "bot";
  45.     newbot.health = 100;
  46.         newbot.max_health = 100;
  47.         if (teamplay)
  48.                 newbot.team = self.team;
  49.         newbot.frags = 0;
  50.         newbot.flags = FL_CLIENT;
  51.         newbot.colormap = 0;
  52.         bprint(ftos(self.colormap));
  53.         newbot.takedamage = DAMAGE_AIM;
  54.         newbot.goalentity = self;
  55.         newbot.movetarget = self;
  56.         newbot.pausetime = 1 + 1*random();
  57.         newbot.deadflag = DEAD_NO;
  58.     newbot.ideal_yaw = newbot.angles * '0 1 0';
  59.         newbot.yaw_speed = 75;
  60.         newbot.items = IT_AXE | IT_SHOTGUN;
  61.         newbot.show_hostile = 0;
  62.         newbot.weapon = 1;
  63.         newbot.effects = 0;
  64.         newbot.ammo_shells = 25;
  65.     newbot.view_ofs = '0 0 25';
  66.  
  67.         newbot.th_xstand   = bot_xstand1; // axe
  68.         newbot.th_stand    = bot_stand1;
  69.         newbot.th_xwalk    = bot_xwalk1;  // axe
  70.         newbot.th_walk     = bot_walk1;
  71.         newbot.th_xstuff   = bot_xstuff1; // axe
  72.         newbot.th_stuff    = bot_stuff1;
  73.         newbot.th_xrun     = bot_xrun1;   // axe
  74.         newbot.th_run      = bot_run1;
  75.         newbot.th_xpain    = bot_xpain1;  // axe
  76.         newbot.th_pain     = bot_pain;
  77.         newbot.th_xdie     = bot_xdie1;   // axe
  78.         newbot.th_die      = bot_die;
  79.         //newbot.th_xmissile = bot_xatk1;   // axe - removed because it was stopping the bot
  80.         //newbot.th_missile  = bot_atk1;    // removed
  81.  
  82.         setmodel (newbot, "progs/player.mdl");
  83.         setsize (newbot, VEC_HULL_MIN, VEC_HULL_MAX);
  84.  
  85. // BG Bot - begin select a spot to spawn bot
  86. // if not deathmatch or coop. starts bot in players starting points
  87.         spot = SelectSpawnPoint ();
  88.  
  89.         newbot.origin = spot.origin + '0 0 1';
  90.         newbot.angles = spot.angles;
  91. // BG Bot - end select a spot to spawn bot
  92.  
  93.     spawn_tfog (newbot.origin);
  94.  
  95.         bprint(newbot.netname);
  96.         bprint(" entered the game\n");
  97.     
  98.         newbot.nextthink = time + 0.05;
  99.     newbot.think = newbot.th_stand;
  100.         spawn_tdeath(newbot.origin, newbot);
  101. // skin
  102.         newbot.skin = 24*random();
  103.         /*
  104.         if (skin1 == 0) skin1 = newbot.skin;
  105.         else if (skin2 == 0) skin2 = newbot.skin;
  106.         else if (skin3 == 0) skin3 = newbot.skin;
  107.         else if (skin4 == 0) skin4 = newbot.skin;
  108.         else if (skin5 == 0) skin5 = newbot.skin;
  109.         else if (skin6 == 0) skin6 = newbot.skin;
  110.         else if (skin7 == 0) skin7 = newbot.skin;
  111.         else if (skin8 == 0) skin8 = newbot.skin;
  112.         */
  113. // roaming AI
  114.         newbot.fl_lead = FALSE;
  115. // name for messages
  116.         newbot.yname = yn;
  117. };
  118.  
  119. void () botrespawn =
  120. {
  121.     local entity spot;
  122.  
  123.         //self.nextthink = time + 10;
  124.  
  125.         self.solid = SOLID_SLIDEBOX;
  126.     self.movetype = MOVETYPE_STEP;
  127.  
  128.         self.flags = FL_CLIENT;
  129.         self.colormap = 0;
  130.     self.classname = "bot";
  131.         self.health = 100;
  132.         self.max_health = 100;
  133.     self.takedamage = DAMAGE_AIM;
  134.     self.deadflag = DEAD_NO;
  135.     self.goalentity = self;
  136.     self.movetarget = self;
  137.         self.pausetime = 0.5 + 1*random();
  138.     self.ideal_yaw = self.angles * '0 1 0';
  139.         self.yaw_speed = 75;
  140.         self.show_hostile = 0;
  141.         self.effects = 0;
  142.         self.view_ofs = '0 0 25';
  143.         self.items = IT_AXE | IT_SHOTGUN;
  144.  
  145.         self.weapon = 1;
  146.         self.ammo_shells = 25;
  147.         self.ammo_nails = 0;
  148.         self.ammo_rockets = 0;
  149.         self.ammo_cells = 0;
  150.  
  151.         self.th_xstand   = bot_xstand1; // axe
  152.         self.th_stand    = bot_stand1;
  153.         self.th_xwalk    = bot_xwalk1;  // axe
  154.         self.th_walk     = bot_walk1;
  155.         self.th_xstuff   = bot_xstuff1; // axe
  156.         self.th_stuff    = bot_stuff1;
  157.         self.th_xrun     = bot_xrun1;   // axe
  158.         self.th_run      = bot_run1;
  159.         self.th_xpain    = bot_xpain1;  // axe
  160.         self.th_pain     = bot_pain;
  161.         self.th_xdie     = bot_xdie1;   // axe
  162.         self.th_die      = bot_die;
  163.         //self.th_xmissile = bot_xatk1;   // axe
  164.         //self.th_missile  = bot_atk1;
  165.  
  166.         self.nextthink = time + 5;
  167.         setmodel (self, "progs/player.mdl");
  168.         setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  169.     spot = SelectSpawnPoint(); 
  170.     setorigin(self, spot.origin);
  171.         self.angles = spot.angles;
  172.         spawn_tfog (self.origin);
  173.     spawn_tdeath(self.origin, self);
  174.         self.nextthink = time + 0.05;
  175.         self.think = self.th_stand;
  176. // skin
  177.         self.skin = ddskin; // copy old skin (has problems)
  178.         /*if (skin1 > 0) self.skin = skin1;
  179.         else if (skin2 > 0) self.skin = skin2;
  180.         else if (skin3 > 0) self.skin = skin3;
  181.         else if (skin4 > 0) self.skin = skin4;
  182.         else if (skin5 > 0) self.skin = skin5;
  183.         else if (skin6 > 0) self.skin = skin6;
  184.         else if (skin7 > 0) self.skin = skin7;
  185.         else if (skin8 > 0) self.skin = skin8;*/
  186. // roaming AI
  187.         self.fl_lead = FALSE;
  188. // messages name
  189.         self.yname = ddyn;
  190. };
  191.  
  192. void() BotLeave =
  193. {
  194.         bprint("bot");
  195.         bprint(" left the game with frags\n");
  196. };
  197.  
  198.